PL( H ԍh@H2D ԍЩ ԍh@H ֍ ԍЩ ԍЩ2 ԍh@c`H hld { L `]Z[  ] fddeL gfg㩰]ZФl~8AL ȱfȱgL(L ɀ0`iȥdȥel~Șe[[\\Ń [łl~[dde[\he]]L e[[\[ɀ) d[\\Ń [l~deL fgfgɷ[\[ł0\Ń0L 80p11qp0q1`fp0gq1`@i ``8@`ɀ`i `8@`l~ [!L 28 i` u"L ȥdfȥeg& ɹ L( u" )8dfȥeg揈8f& ɰ l~ ȩ ABCDEFGHIJKLMNOPQLWB H D LSB MSB MEMORY START-END TARGETS DENSITY INSERTDELETE USER MEMORY X"Y#g&'R @! "i"#&&o n+`LLLLLL LLMLLLLLLL L(LPLGL'LL(L0* i@ `8 ɀɠ`XYXiPY惥XiY慥i(懥i`LT q ňʼn`ͩ Π q (  q L* ꥆiLx 挥(ׅ )捩l| ~  ~  l{ ~| } L*  ө̩Π˅̦͑0˭1̠˙ȩ™ȩ ȩȩAȩj01Y>67 * z (+ H $d%e0˭1̩ԩ$% * z * * Xi恠 ꙰I  怊 z LYc r"ɛ4~ c0cc c IccČ p ~ * i? j8kl򩰅 `v`HH Dک ٥ԅfՅghh`HH Dڠ dԥe آ0ȹ. ) q hh`c  q cńŅ_8(^_ (c 1 q q [^\_cZ`8[([\ * (c q ńŅ^_Zc`[\`cZ (Zc8cƃc8^(^_ƃƂc` 1 !"#L*1N@   Y R@    Y t$%`h~h~Ω͠[ZL L ɀL L Lx"L{"0 Z0L 0 Z0L LLL#L5LFL L"L2 L~ L L8!L!LL"LL#]e]ɆL>ɔL;ɗ]L;ɓLeɥLqɘLɪLqɝLɖLɤL L-p^dq_e 1 q c"epd 1pqqs prL v` q c8ƍ q 0 q q `ꩆjpьi捥l0饌k0 DLP Dȱ M q LP q c G M q c G q c G M"Cȱ)<^id_ee^Ɂedde 1LP)^8^^d^dee^e^d89 q 1 q ȱ q 0LP 1 q ] V kL   A frgsrsr srs ] h(c JvLbc  q cńŅ] V (cо@Q(N 9 >NRUTER< TLUAFED ESU RO SEDOC NOITAZILAITINI RETNIRP RETNE >NRUTER< TLUAFED ESU RO SEDOC RETNIRP RETNE !$#i!$#e!$#8u!$#m!$#8}!$#9y!$#8 a!$# 9q!.$)!.$%!.$85!.$-!.$8=!.$99!.$8 !!.$ 91!3,! !3,!3,8!3,!3,8"##"#3"%1")4$")4,"-)0".%"0,"2+"6#P"63p#,##,$#,)X#,6#-0#-0#-08#-0#-08#-09#-08 #-0 9#08#08#08#09#09#09$%#$%#8$%#$%#8$%8$%9%/2I%/2E%/28U%/2M%/28]%/29Y%/28 A%/2 9Q).#).#8).#).#8).8).9*-0L*-0 l*32 ,$!,$!,$!8,$!,$!8,$!9,$!8 ,$! 9,$8,$8,$89,$8,$89,$9,$9,$98,$9,$98,32!J,32F,328V,32N,328^./0/2! /2!/2!8/2! /2!8/2!9/2!8 /2! 90(!H0(00,!h0,0(2/,!*2/,&2/,862/,.2/,8>2/2!j2/2f2/28v2/2n2/28~24)@243`3"#3"#3"#83"#3"#83"#93"#8 3"# 93%#83%$3%)x34!34!834!34!834!934!8 34! 9348348934834934983494!84!943848!48349!LLLLnLLLLALLLLLLLLLLLL'LLL * (c q ńŅ8(ƃ`,&-' xc q (ec惩(cde 1ुiȅ惠c pcɛ~ ) ӱ)i(惥Ņ0ń0iȅ惠c  cf(ci(惠cӥ(")#!W , ,()LnL (   )(@W Y`iP恩@ (i(恩@W   ( Y䥁ŃŃł` * z * (),-L_()L\()L\ R @!"#L_ * z * ? ij8kl] fdge {  `"  w zɛ~),cъ  q ij ] cЪL $|%}ԩύ$ % { ԭ|$}%` * z * `  I `O ` `  R@! W!L- f&g'- ,- f,g- ]8("p)#qL- *B'-&, +/ L-&'"e$"#e%#rpsq W ]@!R "r#s"# L-p] "rpL !W r"p L-L x  XL , o" n+Xldxh ҍ@@LA ԍ˩̘Hȑ˥̥e̐dː㈱ȑˈdTh`ԍdԥeթ˩̘HԈեɳ0˩Th` " #h&' #&&q` R @! ` W ! `ꥇi } z f"g# f(g)`  "#()]@       L $"]"&")'8(]()) &'(e]]]"ppe]pq&Я'Ы`$v8(包t)卅uwx8tvtwxuu xL- w` t uuvt ɀvv@0L-titɀtu` ) *  j  ʊ ȱ ʊ `@tȥwtȥxtȥ tȥ tȢ. t t `W !"# & '$8(包t)卅u$ʥutt]" ]"H h "v  ""] И Д` wȱ xR @!"#wt&xu'  ȱ 芑 8ttȰu8*t0 $"w")xбwЭ t u]tit]ɀtu穀t`L%L%Ln&Ln)L_%L((L$LfLL ]@L- &ȱ ' "p#q"#()8(p()q) L  ] .  ɀ i  ` ] i ɀп ɼг`%-!.|32/4#%3|'!,&|48%92!-)20|432)&|,!4/4|4!43|%,)&/0%.$,4$53%$##  $ ] P/# q R( q (c]de q q 1c! q ) )@%# q # q  # q c q  dȱ e 1c q  dȱ e 1c q  q q q c q  i ɀ ɼL Ņń] $l# q q ]l#ɛ~ {  o"`XL `HHɀ)Iɀ)I(Lc":Lf"9Li" ɀI)nᄌ { ~ Ɉɛ ` I ␩ ( Dک l" ՅԤ )8fԈ ԅ آ轀.ʠ0 jjjj)iiIȥ)iiIhh` (  l" )   gjjjj)iiIȥg fg ԅfՅg8 آ轀.ʤ0 ꥌ 'g԰f*f hh`R @!"#0`O   YS@ YL-`XXYHcH `"hch` ͩΠ"Jȱ)C8ffgg8ge8fdfgfdffgdffffgiijikjlL 0ȱiggѠiddeL ȥ]fgi)fdde L fdgddeL l~ (  l"Ԇդ ?)08) ****e((ՠ  آ轀.ʠ0 ꩀ   L& (c q _ q ȱdȱe 1c q 3 * }* q (L TARGETS IN INVERSE ARE UNRESOLVED '&$% $% & '  Y`'&8p逅rqs`8prqs`& 'p`pp`"#@,Q&'R @! "i&&g`@,Э XY`,/8̭3ii AN ERROR HAS OCCURRED ----------------------- Common Errors are 1. Typographical 2. Disk is write protected 3. Targets used up 4. Directory or Disk full 5. GRIP altered , q 捥P쥍-L COMMAND SUMMARY ESCAPE or BREAK = RETURN TO COMMAND B#/--!.$35--!29",).+).'!34%2)3+#/--!.$"!2%3#!0%or"2%!+2%452.4/#/--!.$"!2232%!$3%#4/2eg 7372)4%3%#4/2 2&2%!$&),% 7&72)4%&),% $3$)3!33%-",%4/3#2%%. $0$)3!33%-",%4/02).4%2 !%!33%-",% %$)4 0#02).4%2#/$%3 2$2%!$$)2%#4/29 404!2'%40!'% 4!"+%9#/.6%23)/.3"($-%-/2934!24 %.$3/52#%/2$%34).!4)/.offilesorsectors02%3334!24&/2.%840!'%02%33/04)/.&/2,!340!'%02%333%,%#44/2%452.4/7/2+3#2%%.!33%-",9#/--!.$3/.%#/--!.$490%/.,9!,,/7%$0%2,).%period /.%"94%$%#)-!,6!,5%3separatedbycommastofollowquestionmark 5.+./7."2!.#(4!2'%4named!to1tofollowcolon .!-%$4!2'%4$%&).%$!3thisaddressquotationmark 3#2%%.6!,5%3tofollow!3#))6!,5%334/2%$eg   ".%#"-%33!'%#/.42/,)or$).3%24or$%,%4%"94%02%33/04)/.&/2,!340!'%02%3334!24&/2.%840!'%02%333%,%#44/2%452.4/7/2+3#2%%.'%.%2!,).&/2-!4)/.53%2-%-/29istheareaofmemorythatisnotusedby'2)0orthe/perating3ystem4hisistheamountofmemoryavailableforwritingoreditingassemblylanguageprograms$%.3)49isautomaticallydeterminedandset$isksmustbefomattedbeforeuse4!2'%43arecountedonlyifnotdefined'2)0484isafileincludedonthisdiskwhichissuitableforprintingwithawordprocessor)tcontainsmoredetailedcommanddescriptionsandexamples02%33/04)/.&/2,!340!'%02%333%,%#44/2%452.4/7/2+3#2%%.'2)0!33%-",%2RRRRRRRRRRRRRR'2)0)3!&2%%7!2%02/'2!-4()30%2-)435.,)-)4%$#/09).'!.$$)3 42)"54)/.7)4(/54&%%)&4(%53%2&).$36!,5%).4()302/'2!- !'2!45)49#!."%3%.44/"25#%(%.29 0/"/87//$34/#+ /.4!2)/#!.!$! .37).3%2402/'2!-34/2!'%$)3+).$2)6%/.%!.$02%3334!24&/2!#/--!.$35--!29!.$'%.%2!,).&/2-!4)/.02%33(%,0!4!.94)-%#/092)'(4c "25#%(%.29 GRIP ASSEMBLER This program documentation can be found on the Grip disk as an Ascii file (suitable for word processin}g) named GRIP.TXT. Grip is meant for those with experience in 6502 Assembly Language programming. GRIP is an assembler }that will assemble machine language instructions in memory as each line of Assembly Language is entered. Further compiling is} unnecessary and the assembled code can then be written to disk as a file or as sector(s). Furthermore, files or sectors of m }achine language code can be read into memory, edited, and disassembled onscreen or to a printer. To demonstrate the speed  }of GRIP, try this simple exercise. Boot the disk and when the opening screen appears, press the Start key. Now the work scree }n appears and near the lower right corner is a blinking asterisk. This indicates the Command Bar and readiness. Enter the fol }lowing :"DS50851" without the quote marks. After the Return key has been pressed, the screen will fill with assembly language } for the code found at that address which happens to be the Operating System disk handler initialization routine. Now, press }the Start key. Another screen of contiguous disassembly appears. Press it again, or, press the Option key. The option key bac}ks-up the disassembly seventeen bytes. This allows for overlap and some degree of control over what section of code appears o}n screen. Press the Break key or Escape key and once again the asterisk at the command bar begins to blink, signalling readin}ess to accept a new command. Grip has some unusual features which will be described, followed by a listing of available co}mmands, in turn followed by detailed descriptions of these commands complete with examples. Perhaps the most unusual aspec}t of Grip is the availability of it's code to the user. The program starts at memory address 1536 (decimal) and is found in i}t's various pieces and and parts until memory address 14200. Any or all of it can be disassembled, changed, copied or saved a}s a file to incorporate into other programs. From 14210 to 45820 (User Memory) is memory available for programming or storage} of other programs or data for editing or manipulation. Part of this 30K is created by shutting off BASIC and using the Ram o}ption. Unfortunatly this precludes easy access to BASIC routines for study or alteration.If, however, a file of peeked values} was made by BASIC of BASIC, this file would serve the same purposes. Of more interest and readily accessible is the entire O}perating System located from address 49152 to 65535. Note that memory locations and values referred to are in decimal. Also n}ote that hexadecimal modes are not supported, although hexadecimal or binary conversions are available at the touch of the Ta}b key. Finally, Grip determines disk density automatically, pemitting reading from single density disks and writing to double} density disks, or visa-versa. PERIPHERAL SERVICES (a) Help Key The Help key summons onscreen Help pages an}d is available at any time except during disk drive operation. There are three pages available which give brief summaries of }available features. The Start key pages ahead through the three pages and the Option key pages back. To return to the program} at the same point as before the Help key was pressed, press the Select key. (b) Tab Key The Tab key can be pres }sed at any time except during disk drive operation or while using the Help pages. Immediately the cursor will start travellin!}g across the first row of screen display. The bars on this row represent from left to right Binary, Hexadecimal, Decimal, Lea"}st Significant Byte, and Most Significant Byte. Press a "B" and the cursor will stop at the first bar and wait for a binary r#}epresentation (ones and/or zeros) to be entered. When the Return key is hit, a hexadecimal conversion will appear in the Hex $}bar, and a decimal conversion will appear in the decimal bar. Nothing will appear in the LSB or MSB bars since the LSB would %}be the same as the decimal value and the MSB is not required. If an "H" is pressed and a hexadecimal value is entered, all th&}e bars will be filled with values, the Binary bar containing the binary representation of the LSB. The same is true if a deci'}mal is converted by pressing "D" and entering a decimal value. In all cases the Delete/Backspace key provides normal backspac(}ing. Once this service is no longer required, press Escape or Break and continue from the same point as before the Tab key wa)}s pressed. ESCAPE or BREAK Any operation or function can be aborted at any time by pressing the Break or Escap*}e key. This will return you to the Command Bar cue. COMMAND SUMMARY (one) Read sector (two) Write sector (three+}) Read file (four) Write file (five) Disassemble to Screen (six) Disassemble to Printer (seven) Printer Configura,}tion codes (eight) Read Directory (nine) Target Page (ten) Assemble-Edit (1) READ SECTOR This command -}allows a single or multiple disk sectors to be stored in User Memory. The format requires the first letters of the command in.} capitals "RS" followed by the number of the sector to be read eg. "RS107". If more than one sector is desired, consecutive s/}ectors can be read if separated by a hyphen eg. "RS107-124". This will read sectors 107 to 124 inclusive. When the Return key0} is hit, the disk drive will start and do an initial check to determine density, changing density if required. Then the curso1}r will start to blink at the MEMORY START-END bar. This is a request for the memory location that the desired sectors are to 2}be read into eg. "20000-21005". If less or more memory is allocated than is required by the number of sectors, the smaller re3}quirement will be chosen. This means that if not enough memory is provided for the number of sectors to be read (this also ap4}plies to files too long for the amount of memory space provided), the extra sectors/file will be discarded. Therefore precise5} blending of program segments is possible. When the memory locations have been entered in the Memory Start-End bar, the d6}isk drive will start again and read the required sector(s) into memory. The Command Bar cue activates when the operation is c7}omplete. (2) WRITE SECTOR This command follows the same format as Read Sector except that this permits writing s8}pecific sectors on a disk from the memory location you describe. As always, the first letters of the command in capitals, fol9}lowed by the pertinent sector(s) are required eg. "WS107-124" and then the memory locations in the Memory Start-End bar eg. ":}20000-21005". Sectors can be rewritten in whole or part as long as they are started at the beginning. (3) READ FI;}LE This command follows the same format as Read Sector except that this permits reading of any file eg. "DOS.SYS" into the<} memory location described. As always, the first letters of the command in capitals, followed by the file name, are required =}eg. "RFDOS.SYS" and then the memory locations in the Memory Start-End bar eg. "20000-21005". (4) WRITE FILE This>} command follows the same format as Read File except that this permits writing of any file eg. "NEW.SYS" from the memory loca?}tions provided. As always, the first letters of the command in capitals, followed by the file name, are required eg. "WFNEW.S@}YS" and then the memory locations in the Memory Start-End bar eg. "20000-21005". (5) DISASSEMBLE to SCREEN The cA}ommands to disassemble will examine the machine language code at chosen memory locations and convert it to assembly language.B} If a section of disassembly on screen seems nonsensical, press the Option key and the disassembly will start seventeen bytesC} farther back in memory, possibly picking up instructions which rationalize the original section. Pressing the Start key willD} present the next screen of disassembly without skipping or overlapping bytes. Line numbers are not used since actual memory E}addresses are provided. The command format requires only a starting address for disassembly, although it will obey an ending F}address if one is supplied eg. "DS1536" or "DS1536-1556". (6) DISASSEMBLE to PRINTER The commands to disassembleG} will examine the machine language code at chosen memory locations and convert it to assembly language. In this case the disaH}ssembly will be sent to the printer in the same format as it would appear on screen. Line numbers are not used since actual mI}emory addresses are provided. A starting and an ending address must be provided eg. "DP1536-1780". The Option and Start keys J}will have no effect while disassembling to printer. However if a problem is encountered, press the Escape or Break key to aboK}rt the operation. The disassembly is also presented on screen so that the printer can be monitored. In order to control the pL}rinted page length or type style and other printer options, read heading seven Printer Configuration codes. (7) PRIM}NTER CONFIGURATION codes Since all printers have options in the way that the printed page is formatted, Grip allows full aN}dvantage to be taken of these by sending fourteen bytes of printer codes before and after each disassembly. These codes are wO}ritten by entering "PC" at the command bar prompt. A screen will appear which asks for Printer Initialization codes. (NOTE : P}Printer configurization codes are written directly back to the disk therefore be sure the copy of Grip does not have a write-Q}protection tab applied.) These are the codes which will be sent to the printer to set it up before it receives data eg. The dR}efault codes are for an Epson LX80 and send (a) the reset code (b) set the right margin to 40 columns (c) set skip over perS}foration to 10 lines (d) enable the paper out sensor . Each byte must either be changed or accepted at it's default setting T}by hitting the return key. When the last byte is entered, these codes will be written as a permanent record and the Printer TU}ermination codes will be presented for editing. The default in this instance is simply a form feed to top of next page while V}forcing the printer buffer to the printer. This fourteen byte group (in this instance containing only one instruction) is senW}t at the end of each disassembly before control is returned to the command bar. (8) READ DIRECTORY If files are X}to be read or written to disk a look at the directory is necessary. The command is "RD". This will present the Directory on tY}he disk or garbage if the disk does not have a Dos compatible Directory. The first sector used by the file is presented as weZ}ll as the total number of sectors used to facilitate rebuilding of files if accidentally erased. Grip will read or write to l[}ocked files as well as unprotected files but other Dos commands are not supported since the Directory can be manipulated dire\}ctly by reading the VTOC (Volume Table Of Contents) and the Directory into User Memory (Sectors 360 to 368 inclusive). Since ]}all the Directory will not fit on one screen, press the Start key for the next screen or Escape/Break to return to the comman^}d bar. A feature of Grip permits filenames to be used containing any characters. Therefore, files can be written to a Dos dis_}kette that are unrecognized by Dos and unable to be erased by Dos. (9) TARGET PAGE The Target Page is a record o`}f Branch Targets used in assembly. Targets are named "A" to "Q" and are used as substitutes for addresses when the desired bra}anching address is unknown. The command "TP" presents the Targets on screen. If unused, each Target will be capitalized follob}wed by zeros. If it has been used but is presently unused, it will be followed by the address it represented last. If it is pc}resently being used and waiting to be defined, the capital will be inverted followed by zeros or the address it represented ld}ast. In this case it will also be counted in the Target bar at the lower right side of the work screen. Finally, if the targee}t is displayed as lowercase inverted, this means the target has been pre-defined as the address which follows it. This targetf} will not be counted in the Target bar since it has not been put into effect. It can also be re-pre-defined without having beg}en used. The use of Targets will be discussed further in the following section on Assembling-Editing. (10) ASSEMBLEq}.?BrGRIP TXTB-----------BGRIP BASSEMBLER BCOPYRIGHT B (c) 1986 BBRUCE HENRYB------------EDIT When Assembly Language programming is necessary, the command format requires a starting address in User Memory wherer} the assembled Machine Language can be stored eg."AE20000". It is called assemble-edit because existing programs or progras}m segments can be read into memory and altered. This can be accomplished by overwriting Machine Language instructions or by ut}sing two basic editing aids (a) CONTROL D which will delete a byte at the present memory location and pull every value from u}the top of user memory one byte closer. It also switches the large dot between the words Insert - Delete on and off to indicav}te when the job has been completed (b) CONTROL I which will insert a NOP [no operation] instruction at the present memory low}cation and push every value to the top of user memory one byte farther. If the top of user memory contains instructions, the x}last byte will be lost. It also switches the large dot on and off to indicate when the job has been completed.When Assembly-y}Edit is chosen, the address will appear at the top of the work screen followed by a visible cursor. Assembly language insructz}ions can now be entered one line at a time with the Delete/Backspace key offering normal editing control over that line. Only{} one instruction may be used per line. When the return key is hit the appropriate Machine Language instructions will be store|}d at those memory locations up to the next available memory location which is then displayed on the next line down on the scr}}een. Spaces can be ignored and commas preceding offset X or Y are not used. To become familiar with Grip assembly conventions~}, disassemble thru the Operating System until all the addressing modes have appeared. Grip also supports special assembly com}mands which will now be described. ASSEMBLY COMMANDS As well as the complete set of 6502 instructions, Grip also} supports five special commands. These commands can not be mixed on any one line with each other or with 6502 instructions (e}xcept for the colon and question mark which are used exclusivly with Branch instructions). If they are mixed, the first speci}al command will be given precedence and all else will be ignored. This does not include CONTROL D or CONTROL I which can be u}sed at any time during assembly to delete or insert bytes. (a) QUOTATION MARK ["] - This is the command to poke into memor}y the screen (internal) value of each character that follows until the place where the return key was hit. eg. (at address tw}o thousand) 20000 "A screen message This would use 16 bytes and the next available address would be 20016. } (b) PERIOD [.] - This is the command to to poke into memory the value which follows. It must not be larger than 256. Conse}cutive values can be presented if separated by commas eg. (at address two thousand) 20000 256,255,254,1,2,3,4,5,}6 This would use nine bytes and the next available address would be 20009. (c) INVERTED - If Ascii values are required }switch on the inverse key and enter the characters. The value of each character in inverse will be poked into memory. Since m}ost printers normally don't print inverted characters, this example will substitute normal letters for inverted eg. (at addre}ss 20000) 20000 Remember inverted equals Ascii. This example would use 31 bytes and the next available address w}ould be 20031. (d) QUESTION MARK [?] - This command and the next are used exclusively with 6502 Branch instructions. One l}etter names can be given to undetermined Branch destination addresses (Targets) and later defined as the addresses are reache}d. Also, in the case of backwards Branching, the Target can be pre-defined as it is passed (using the colon command) and late}r resolved as the Branching instruction is entered. There are 17 Targets named A to Q. Their status can be checked by enterin}g "TP" in the command bar and by the count kept in the Target bar near the lower right of the screen. Targets are named by fo}llowing the Branch instruction with a "?" and the chosen name "A" to "Q" eg. "?F" Targets can be used again once they hav}e been defined. Examples will be found following a description of the Colon command (next). (e) COLON [:] - The Colon comm}and defines those Targets named by Branch instructions. As mentioned, the Targets can also be pre-defined if the address is p}assed before the Branch instruction is reached. This will not prevent it from being pre-defined again if a poor choice was ma}de. The colon followed by the Target name also will define the address named by an earlier Branch instruction (forward branch}ing). This will subtract one from the Target bar count. Targets are defined by entering a ":" followed by the Target name whe}n the desired address has been reached eg. ":B". A short example of assembly language using Targets is shown. The pre-defined} and later named Target will be Target "A" while the Target named and later defined will be Target "H". This assembly will st}art at token address 20000. Note the byte count. 20000 LDY #155 20002 :A 20002 DEY } 20003 BEQ ?B 20005 BNE ?A 20007 :B 20007 JMP (30000) At address 20002 "A" is pre-defi}ned as that address. At address 20003, "B" is named as the unknown destination of the Branch on Equal instruction. At address} 20005, "A" is called up and defined as address 20002 and at address 20007 "B" is defined. If this program segment was now di}sassembled it would appear as follows : 20000 LDY #155 20002 DEY 20003 BEQ 20007 } 20005 BNE 20002 20007 JMP (30000) --------------------------------------------------------- This covers al}l the GRIP ASSEMBLER commands and features. If questions remain that are not covered by this summary, specific questions can }be sent along with a stamped self-addressed envelope to : Bruce Henry P.O. Box 172 Woodstock, O}ntario Canada N4S 7W8 ssed envelope to : Bruce Henry P.O. Box 172 Woodstock, O'